const express = require("express");
const router = express.Router();
const User = require("../data/models/User");
const bcrypt = require("bcrypt");
module.exports = router;

router.get("/", async (req, res) => {
  // 安装
  const Us = await User.find();
  if (Us.length == 0) {
    User.create({ account: "user", name: "user", password: bcrypt.hashSync("123456", 5) }, () => {
      res.send({ Code: 200, Msg: "安装成功" });
    });
  } else res.send({ Code: 500, Msg: "请勿重复安装" });
});
